package com.yt.chapter1.thread;

public class MyThread extends Thread {
    @Override
    public void run() {
        try
        {
            for(int i=0;i<10;i++)
            {
                int time=(int)(Math.random()*1000);
                Thread.sleep(time);
                System.out.println("当前线程名称="+Thread.currentThread().getName());
            }
        }
        catch(InterruptedException e)
        {
            e.printStackTrace();
        }
    }
}
